using Hbt.Infrastructure.Data.Seeds;
using Hbt.Infrastructure.Data.Seeds.Auth;
using Hbt.Infrastructure.Data.Seeds.Biz;
using Hbt.Infrastructure.Data.Seeds.Biz.Dict;
using Hbt.Infrastructure.Data.Seeds.Biz.Logistics;
using Hbt.Infrastructure.Data.Seeds.Biz.Accounting;
using Hbt.Infrastructure.Data.Seeds.Biz.Hrm;
using Hbt.Infrastructure.Data.Seeds.Biz.Translation;
using Hbt.Infrastructure.Data.Seeds.Generator;
using Hbt.Infrastructure.Data.Seeds.Workflow;
using Hbt.Infrastructure.Data.Seeds.Biz.Routine;

namespace Hbt.Infrastructure.Extensions;

/// <summary>
/// 种子数据服务集合扩展
/// </summary>
public static class HbtSeedsCollectionExtensions
{
    /// <summary>
    /// 添加种子数据服务
    /// </summary>
    /// <param name="services">服务集合</param>
    /// <returns>服务集合</returns>
    public static IServiceCollection AddHbtSeeds(this IServiceCollection services)
    {
        // 注册协调器服务
        services.AddScoped<HbtDbSeedWorkflowCoordinator>();
        services.AddScoped<HbtDbSeedTranslationCoordinator>();
        services.AddScoped<HbtDbSeedDictCoordinator>();
        services.AddScoped<HbtDbSeedLogisticsCoordinator>();
        services.AddScoped<HbtDbSeedAccountingCoordinator>();
        services.AddScoped<HbtDbSeedHrmCoordinator>();
        services.AddScoped<HbtDbSeedIdentityCoordinator>();
        
        // 注册缺失的协调器服务
        services.AddScoped<HbtDbSeedMenuCoordinator>();
        services.AddScoped<HbtDbSeedGeneratorCoordinator>();
        services.AddScoped<HbtDbSeedRoutineCoordinator>();
        services.AddScoped<HbtDbSeedDeptCoordinator>();
        services.AddScoped<HbtDbSeedRelationCoordinator>();

        // 注册多库种子数据服务
        services.AddScoped<HbtIdentityDBSeed>();
        services.AddScoped<HbtGeneratorDbSeed>();
        services.AddScoped<HbtWorkflowDbSeed>();
        services.AddScoped<HbtBusinessDbSeed>();

        return services;
    }
}